$(function () {
	$("#jqGrid").jqGrid({
		url: baseURL + '/blackList/list',
		datatype: "json",
		colModel: [
			{ label: 'ID', name: 'id', width: 30, key: true },
            { label: '用户名', name: 'affectedPerson', width: 30 },
            { label: '添加时间', name: 'createTime', width: 30 ,formatter: function(value, options, row){
                    return  parseTime(value);
                }},
			{ label: '操作',  width: 30 ,formatter: function(value, options, row){
                    return '<span class="btn btn-danger" onclick="del('+row.id+')">移出黑名单</span>';
                }}
		],
		viewrecords: true,
		height: 500,
		rowNum: 10,
		rowList : [10,30,50],
		rownumbers: true, 
		rownumWidth: 25, 
		autowidth:true,
		multiselect: true,
		scroll: false,
        scrollOffset: 0,
		pager: "#jqGridPager",
		jsonReader : {
			root: "data.dataList",
			page: "data.currentPage",
			total:"data.total",
			records: "data.totalNum"
		},
		prmNames : {
			page:"pageNo", 
			rows:"pageSize", 
			order: "order"
		},
		gridComplete:function(){
            //隐藏grid底部滚动条
            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" }); 
        }
    });
});
var vm = new Vue({
	el:'#rrapp',
	data:{
		q:{
			key: null
		},
		showList: true,
		title: null,
		refuseObj:{
			"comments":null,
			"id":null,
			"trailId":null
		}
	},
	methods: {
		query: function () {
			vm.reload();
		}

	},
	mounted:function () {
	}
});
function del(id) {
	confirm("您确定删除吗？",function () {
        var param ={
            'id':id
        }
        $.ajax({
            type: "POST",
            url: baseURL + "/blackList/delete",
            dataType: "json",
            contentType:"application/json",
            data:JSON.stringify(param),
            success: function(r){
                if (r.code===0) {
                    alert(r.info,function () {
                        location.reload();
                    })
                }else{
                    alert(r.info);
                }

            }
        });
    })

}